<?php

namespace common\models\db\tables;

use Yii;

/**
 * This is the model class for table "{{%custom_bank_card}}".
 *
 * @property int $id
 * @property string $plat_no
 * @property int $custom_id
 * @property string $plat_cust_no 客户编码
 * @property string $mobile_no 预留手机号
 * @property string $open_bank 开户行
 * @property string $card_no 卡号
 * @property string $pay_code 支付通道 （051-易宝支付）
 * @property string|null $return_url 跳转地址（注：该字段仅在企业绑卡时上送）
 * @property string|null $notify_url 企业新增绑卡审核结果通知地址
 * @property int $created_at
 * @property int $updated_at
 * @property int|null $deleted_at
 * @property int|null $created_by
 * @property int|null $updated_by
 * @property int $status 状态
 */
class CustomBankCard extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%custom_bank_card}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['plat_no', 'custom_id', 'plat_cust_no', 'mobile_no', 'open_bank', 'card_no', 'pay_code', 'return_url', 'notify_url', 'created_at', 'updated_at', 'deleted_at', 'created_by', 'updated_by', 'status'], 'trim'],
            [['plat_no', 'custom_id', 'plat_cust_no', 'mobile_no', 'open_bank', 'card_no', 'pay_code', 'created_at', 'updated_at'], 'required'],
            [['custom_id', 'created_at', 'updated_at', 'deleted_at', 'created_by', 'updated_by', 'status'], 'integer'],
            [['plat_no', 'plat_cust_no', 'return_url', 'notify_url'], 'string', 'max' => 180],
            [['mobile_no'], 'string', 'max' => 20],
            [['open_bank'], 'string', 'max' => 6],
            [['card_no'], 'string', 'max' => 50],
            [['pay_code'], 'string', 'max' => 3],
            [['return_url', 'notify_url', 'deleted_at', 'created_by', 'updated_by'], 'default', 'value' => null],
            [['status'], 'default', 'value' => 10],
            [['card_no'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'plat_no' => Yii::t('app', 'Plat No'),
            'custom_id' => Yii::t('app', 'Custom ID'),
            'plat_cust_no' => Yii::t('app', '客户编码'),
            'mobile_no' => Yii::t('app', '预留手机号'),
            'open_bank' => Yii::t('app', '开户行'),
            'card_no' => Yii::t('app', '卡号'),
            'pay_code' => Yii::t('app', '支付通道 （051-易宝支付）'),
            'return_url' => Yii::t('app', '跳转地址（注：该字段仅在企业绑卡时上送）'),
            'notify_url' => Yii::t('app', '企业新增绑卡审核结果通知地址'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
            'deleted_at' => Yii::t('app', 'Deleted At'),
            'created_by' => Yii::t('app', 'Created By'),
            'updated_by' => Yii::t('app', 'Updated By'),
            'status' => Yii::t('app', '状态'),
        ];
    }
}
